Skip to content

Better normalization supporting different normalization transforms for input/target and different normalization per channel#34

Merged
wli51 merged 15 commits into
WayScience:mainfrom
wli51:better-normalization
Jul 21, 2026
Merged

Better normalization supporting different normalization transforms for input/target and different normalization per channel#34
wli51 merged 15 commits into
WayScience:mainfrom
wli51:better-normalization

Conversation

@wli51

@wli51 wli51 commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Useful for training models whose input and target takes different ranges and experimenting with input engineering combining multiple channels of different value ranges

wli51 added 5 commits June 10, 2026 09:29
…eDataset and CropImageDataset for training with input and target that can take different value ranges
…ated as a subpackage, moved crop generator protocol to its own stand aloen module and center and point-centered crop generator functions in their respective modules under the new subpackage.
…ubpackage while supporting older import signatures for compatibility
Comment thread src/virtual_stain_flow/datasets/base_dataset.py
Comment on lines +162 to +176
def _apply_input_transforms(
self,
image: np.ndarray,
) -> np.ndarray:
for transform in self.input_transforms:
image = transform.apply(img=image)
return image

def _apply_target_transforms(
self,
image: np.ndarray,
) -> np.ndarray:
for transform in self.target_transforms:
image = transform.apply(img=image)
return image

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These feel mostly duplicative. Is there an abstraction you could use for both cases?

Comment thread src/virtual_stain_flow/transforms/README.md Outdated
Comment thread src/virtual_stain_flow/transforms/README.md
Comment thread src/virtual_stain_flow/transforms/channelwise.py
Comment thread src/virtual_stain_flow/transforms/channelwise.py
@wli51

wli51 commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks @d33bs for reviewing. Merging now1

@wli51
wli51 merged commit 23b6061 into WayScience:main Jul 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants